package com.todo.strategy.card.infrastructure.mapper;


import com.todo.strategy.card.infrastructure.entity.condition.CardStrategyCondition;
import com.todo.strategy.card.infrastructure.entity.po.CardStrategyPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (CardStrategy)表数据库访问层
 *
 * @author zhangwenxiang
 * @since 2024-03-04 00:19:44
 */
@Mapper
public interface CardStrategyMapper {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    CardStrategyPO queryCardStrategyPOById(@Param("id") Long id);


    /**
     * 新增数据
     *
     * @param cardStrategy 实例对象
     * @return 影响行数
     */
    int insertCardStrategyPO(CardStrategyPO cardStrategy);

    /**
     * 批量新增数据
     *
     * @param cardStrategyPOList List<CardStrategy> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<CardStrategyPO> cardStrategyPOList);


    /**
     * 修改数据
     *
     * @param cardStrategy 实例对象
     * @return 影响行数
     */
    int updateCardStrategyPOById(CardStrategyPO cardStrategy);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 影响行数
     */
    int removeCardStrategyPOById(@Param("id") Long id);

    /**
     * 根据卡片id查询卡片列表详情
     *
     * @param cardId
     * @return
     */
    List<CardStrategyPO> queryCardStrategyByCardId(@Param("cardId") Long cardId);

    /**
     * 多条件查询旅游卡攻略列表
     *
     * @param cardStrategyCondition
     * @return
     */
    List<CardStrategyPO> queryCardStrategyByCondition(CardStrategyCondition cardStrategyCondition);

    /**
     * 多条件查询旅游卡攻略数量
     *
     * @param cardStrategyCondition
     * @return
     */
    Long queryCountByCondition(CardStrategyCondition cardStrategyCondition);
}

